﻿using System;

namespace LeanEngine.Extensions
{
    /// <summary>
    /// Extension methods for the data type System.Int64.
    /// </summary>
    public static class Int64Extensions
    {
        #region Validation Extensions

        /// <summary>
        /// Evaluates whether the current value is less than or equal the comparison value.
        /// </summary>
        /// <param name="number">The current value.</param>
        /// <param name="value">The comparison value.</param>
        public static bool IsLessThan(this Int64 number, Int64 value)
        {
            return (number < value);
        }

        /// <summary>
        /// Evaluates whether the current value is less than the comparison value.
        /// </summary>
        /// <param name="number">The current value.</param>
        /// <param name="value">The comparison value.</param>
        public static bool IsLessThanEqual(this Int64 number, Int64 value)
        {
            return (number <= value);
        }

        /// <summary>
        /// Evaluates whether the current value is greater than the comparison value.
        /// </summary>
        /// <param name="number">The current value.</param>
        /// <param name="value">The comparison value.</param>
        public static bool IsGreaterThan(this Int64 number, Int64 value)
        {
            return (number > value);
        }

        /// <summary>
        /// Evaluates whether the current value is greater than or equal the comparison value.
        /// </summary>
        /// <param name="number">The current value.</param>
        /// <param name="value">The comparison value.</param>
        public static bool IsGreaterThanEqual(this Int64 number, Int64 value)
        {
            return (number >= value);
        }

        /// <summary>
        /// Evaluates whether the current value is between two comparison values.
        /// </summary>
        /// <param name="number">The current value.</param>
        /// <param name="minValue">The lower comparison value.</param>
        /// <param name="maxValue">The higher comparison value.</param>
        public static bool IsBetween(this Int64 number, Int64 minValue, Int64 maxValue)
        {
            return (number >= minValue && number <= maxValue);
        }

        /// <summary>
        /// Evaluates whether the current value not is between two comparison values.
        /// </summary>
        /// <param name="number">The current value.</param>
        /// <param name="minValue">The lower comparison value.</param>
        /// <param name="maxValue">The higher comparison value.</param>
        public static bool IsNotBetween(this Int64 number, Int64 minValue, Int64 maxValue)
        {
            return (number < minValue && number > maxValue);
        }

        /// <summary>
        /// Evaluates whether the current value is not equal to the value of comparison.
        /// </summary>
        /// <param name="number">The current value.</param>
        /// <param name="value">The comparison value.</param>
        public static bool NotEquals(this Int64 number, Int64 value)
        {
            return number != value;
        }

        #endregion
    }
}
